<?php ob_start(); ?>
<body onload="HideSearchControl();">

<?php if (! $this->_tpl_vars['Page']->GetVisualEffectsEnabled()): ?>
<!-- Turn on visual effects -->
<script type="text/javascript">
    jQuery.fx.off = true;
</script>
<?php endif; ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'common/site_header.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<table>
    <?php if ($this->_tpl_vars['Page']->GetShowUserAuthBar() || $this->_tpl_vars['Page']->GetShowPageList() || $this->_tpl_vars['Page']->GetPrinterFriendlyAvailable() || $this->_tpl_vars['Page']->GetPrinterFriendlyAvailable() || $this->_tpl_vars['Page']->GetExportToExcelAvailable() || $this->_tpl_vars['Page']->GetExportToWordAvailable() || $this->_tpl_vars['Page']->GetExportToXmlAvailable() || $this->_tpl_vars['Page']->GetExportToCsvAvailable() || $this->_tpl_vars['Page']->GetExportToPdfAvailable()): ?>
    <tr>
        <td colspan="2" class="top_panel">
        <a class="hide_right_panel" href="#" onclick="<?php echo 'require(PhpGen.ModuleList([PhpGen.Module.PG.NavBar], true), function(navBar) { navBar.ToggleSideBar(); }); return false;'; ?>
">
            <?php echo $this->_tpl_vars['Captions']->GetMessageString('ShowHideNavbar'); ?>

        </a>
        </td>
    </tr>
    <?php endif; ?>

    <tr>    
        <td valign="top">
        <?php if ($this->_tpl_vars['Page']->GetShowUserAuthBar() || $this->_tpl_vars['Page']->GetShowPageList()): ?>

            <div id="right_side_bar">
            <?php if ($this->_tpl_vars['Page']->GetShowUserAuthBar()): ?>
                <div class="auth_bar">
                <?php if ($this->_tpl_vars['Page']->IsCurrentUserLoggedIn()): ?>
                    <span id="loggen_in_as_text"><?php echo $this->_tpl_vars['Captions']->GetMessageString('LoggedInAs'); ?>
</span>:<br>
                    <span id="user_name"><?php echo $this->_tpl_vars['Page']->GetCurrentUserName(); ?>
</span><br>
                    <a href="login.php?operation=logout"><?php echo $this->_tpl_vars['Captions']->GetMessageString('Logout'); ?>
</a>
                <?php else: ?>
                    <span id="loggen_in_as_text"><?php echo $this->_tpl_vars['Captions']->GetMessageString('YouAreNotLoggedIn'); ?>
</span><br>
                    <a href="login.php"><?php echo $this->_tpl_vars['Captions']->GetMessageString('Login'); ?>
</a>
                <?php endif; ?>
            <?php endif; ?>
            </div>

            <?php if ($this->_tpl_vars['Page']->GetShowPageList()): ?>
                <div id="pages_section" class="page_list">
                    <img src="images/home.gif" /><span id="current_page_text"><?php echo $this->_tpl_vars['Captions']->GetMessageString('CurrentPage'); ?>
::</span><br/><span id="current_page" style="white-space: normal; padding-left: 20px"><?php echo $this->_tpl_vars['Page']->GetShortCaption(); ?>
</span>
                    <?php echo $this->_tpl_vars['PageList']; ?>

                </div>
            <?php endif; ?>

        </div>
        <script type="text/javascript">
            <?php echo '
            require(PhpGen.ModuleList([PhpGen.Module.PG.NavBar], true), function(navBar)
            {
                navBar.ApplySideBarPosition();
            });
            '; ?>

        </script>
        <?php endif; ?>
        </td>

        <td valign="top">
            <div style="margin-bottom: 10px;">
                <h2 class="page_header" style="margin: 0px;"><?php echo $this->_tpl_vars['Page']->GetCaption(); ?>
</h2>
            </div>

            <?php if ($this->_tpl_vars['Page']->GetAdvancedSearchAvailable()): ?><?php echo $this->_tpl_vars['AdvancedSearch']; ?>
<?php endif; ?>

            <?php echo $this->_tpl_vars['ContentBlock']; ?>


        </td>
    </tr>
</table>

<?php echo $this->_tpl_vars['Page']->GetFooter(); ?>


</body>
<?php $this->_smarty_vars['capture']['default'] = ob_get_contents();  $this->assign('ContentBlock', ob_get_contents());ob_end_clean(); ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "common/base_page_template.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>